package wt.hpad.model.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 菜品详情记录
 * Created by wt on 12.14.
 */

public class DishDetail implements Parcelable {
    public int sid;
    public int dishID;      // 菜品编号
    public String dishName;    // 菜名
    public int dishNum;    // 点菜的数量
    public int dishTypeCode;    // 分类码
    public int dishIsCompleted; // 1、未上、2、已上、3、退菜、4、赠送 、5、保留
    public String tipOfCook;      // 备注口味或做法
    public String tipOfException; // 退菜或异常原因

    public DishDetail(int dishID, int dishNum, String dishName, int dishTypeCode, int dishIsCompleted, String tipOfCook) {
        this.dishID = dishID;
        this.dishName = dishName;
        this.dishNum = dishNum;
        this.dishTypeCode = dishTypeCode;
        this.dishIsCompleted = dishIsCompleted;
        this.tipOfCook = tipOfCook;
    }

    public DishDetail(int dishID, int dishNum, String dishName,int dishTypeCode) {
        this.dishID = dishID;
        this.dishName = dishName;
        this.dishNum = dishNum;
        this.dishTypeCode = dishTypeCode;
    }

    public DishDetail(int sid, int dishID, String dishName, int dishNum, int dishTypeCode, int dishIsCompleted, String tipOfCook, String tipOfException) {
        this.sid = sid;
        this.dishID = dishID;
        this.dishName = dishName;
        this.dishNum = dishNum;
        this.dishTypeCode = dishTypeCode;
        this.dishIsCompleted = dishIsCompleted;
        this.tipOfCook = tipOfCook;
        this.tipOfException = tipOfException;
    }

    protected DishDetail(Parcel in) {
        sid = in.readInt();
        dishID = in.readInt();
        dishName = in.readString();
        dishNum = in.readInt();
        dishTypeCode = in.readInt();
        dishIsCompleted = in.readInt();
        tipOfCook = in.readString();
        tipOfException = in.readString();
    }

    public static final Creator<DishDetail> CREATOR = new Creator<DishDetail>() {
        @Override
        public DishDetail createFromParcel(Parcel in) {
            return new DishDetail(in);
        }

        @Override
        public DishDetail[] newArray(int size) {
            return new DishDetail[size];
        }
    };

    @Override
    public String toString() {
        return "{sid=" + sid
                + ",dishID=" + dishID
                + ",dishName=" + dishName
                + ",dishNum=" + dishNum
                + ",dishTypeCode=" + dishTypeCode
                + ",dishIsCompleted=" + dishIsCompleted
                + ",tipOfCook=" + tipOfCook
                + ",tipOfException=" + tipOfException
                + "}";
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(sid);
        dest.writeInt(dishID);
        dest.writeString(dishName);
        dest.writeInt(dishNum);
        dest.writeInt(dishTypeCode);
        dest.writeInt(dishIsCompleted);
        dest.writeString(tipOfCook);
        dest.writeString(tipOfException);
    }
}
